package hackathon1212.example;

import java.util.Map;

import hackathon1212.ServletPojoAdapter;

public class FrameworkExample extends ServletPojoAdapter {	

	private static final long serialVersionUID = -6624145272565584063L;
	
	@Override
	protected Member getBusinessMethod(Map<String, String[]> params){
		final String[] args = params.get("cardNo");
		if(args != null && args.length > 0){
			final Member m = FrameworkExampleDAO.fetchDAO().fetchMemberByCardNo(args[0]);
			return m;
		}
		return null;
	}
	@Override
	protected Member postBusinessMethod(Map<String, String[]> params){
		final String[] args = params.get("cardNo");
		if(args != null && args.length > 0){
			final String[] id = params.get("twitter");
			if(id != null && id.length > 0){
				return FrameworkExampleDAO.fetchDAO().updateTwitter(args[0],id[0]);
			}
		}
		return null;
	}
	
}
